Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug registering component with static view.is prop but no view.file prop #627

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

ericyhwang
Copy link
Contributor

There are many ways that components can define their view files. The usual way is for the component class to directly point to its view file, such as via a static view.file property.

One lesser-used way is to infer the view name based off the component name.

In this example below, the component doesn't explicitly define a view file. So on component registration, Derby looks for a previously registered view named "simple-box".

class SimpleBox {
  static view = {
    is: 'simple-box'
  }
}

That inference isn't working when registering via app.component(SimpleBox), but it does work with the older signature that passes a custom component name in the call, app.component('simple-box', SimpleBox).

This fixes the inference in the first case, where Derby reads the component name off of the class directly.

@ericyhwang ericyhwang requested a review from craigbeck January 30, 2024 21:42
Copy link
Contributor

@craigbeck craigbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ericyhwang ericyhwang merged commit 006e372 into master Jan 30, 2024
5 checks passed
@ericyhwang ericyhwang deleted the fix-component-inferred-view branch January 30, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants